# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Joakim Hernberg <jhernberg at alchemy dot lu>

pkgname=rt-tests
pkgver=2.5
pkgrel=2
pkgdesc="A collection of latency testing tools for the linux(-rt) kernel"
arch=(loong64 x86_64)
url="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/about/"
license=(GPL2)
groups=(realtime)
depends=(glibc)
makedepends=(numactl python)
optdepends=(
  'bash: for determine_maximum_mpps.sh'
  'numactl: for cyclictest, oslat and signaltest'
  'python: for get_cyclictest_snapshot and hwlatdetect'
)
source=(https://git.kernel.org/pub/scm/utils/$pkgname/$pkgname.git/snapshot/$pkgname-$pkgver.tar.gz)
sha512sums=('137ee2a0d3417843d7211fc3cb203d61ca528e0b2bd70ad9931e54324f600a73c4628f9c6cbe87d2df216eb26050e042d820c0bb65421bf3482c8bcb4fc657e3')
b2sums=('d59174d509588439fb86814158338dba6623b1b1c06d9607d30a3553b3604b83e8ae3b74d54420974ea6459a0eedfefef4b0e523a1422570e327ef3574ebd91a')

build() {
  export PYLIB=$(python -c 'import distutils.sysconfig;  print(distutils.sysconfig.get_python_lib())')
  make -C $pkgname-$pkgver
}

package() {
  make prefix=/usr DESTDIR="$pkgdir" install -C $pkgname-$pkgver
  install -vDm 644 $pkgname-$pkgver/{MAINTAINERS,README.markdown} -t "$pkgdir/usr/share/doc/$pkgname/"
}
